/*
 * @Author: 赵成功a 3063126760@qq.com
 * @Date: 2024-12-26 00:12:20
 * @LastEditors: 赵成功a 3063126760@qq.com
 * @LastEditTime: 2024-12-26 02:18:52
 * @FilePath: /linux-learning/12-25/Client.cpp
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

#include"Init.hpp"
#include <unistd.h>
int main()
{
    string s;
    int fd=open(FIFE_PIPE,O_WRONLY|O_APPEND);
    if(fd<0){
        perror("open");
        exit(OPEN_ERR);
    }
    while(true)
    {
        cout<<"Client send@:";
        getline(cin,s);
        size_t n=write(fd,s.c_str(),s.size());
        sleep(3);
    }
    int n=close(fd);
    if(n<0){
        perror("close");
        exit(CLOSE_ERR);
    }
    return 0;
}